package com.worldcup.service.impl;

import com.worldcup.dao.TravelEventMapper;
import com.worldcup.model.TravelEvent;
import com.worldcup.model.enums.TravelEventStatusEnum;
import com.worldcup.service.TravelEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.List;

/**
 * @author duwan.zq
 * @date 2018/06/02
 */
@Service
public class TravelEventServiceImpl implements TravelEventService {

    @Autowired
    private TravelEventMapper travelEventMapper;

    @Override
    public List<TravelEvent> getTravelEventListByRec(String openid, TravelEventStatusEnum travelEventStatusEnum) {
        Assert.notNull(travelEventStatusEnum, "travelEventStatusEnum is null");
        return travelEventMapper.selectByRecOpenid(openid, travelEventStatusEnum.getValue());
    }
}
